package org.needcoke.hs.signature;

import org.needcoke.hs.bean.InterceptRule;
import org.needcoke.hs.http.Request;

import java.util.Map;

/**
 * 签名接口
 *
 * @author warren
 */
public interface Signature {

    /**
     * 添加参数
     */
    void addParam(String name, String value);

    void addParam(Map<String,String> paramMap);

    /**
     * 设置body
     */
    void addApplicationBody(String body);

    /**
     * 设置任意组name和value之间的连接符
     */
    void setConnectorBetweenNameAndValue(String connector);

    /**
     * 设置两组name和value之间的连接符
     */
    void setConnectorBetweenTwoGroup(String connector);

    /**
     * 设置凭证
     */
    void setProof(String proof, boolean end);

    /**
     * 设置凭证
     */
    void setProof(String proof);

    void setSortedFunction(SortedFunction function);

    void setSignFunction(SignFunction function);

    void setSignCode(SignCode signCode);

    Signature copy();

    String sign();

    boolean isWithFormBody();

    boolean isWithApplicationBody();

    void setSignatureLocation(SignatureLocation location);

    void preventSignature(Request request, String signature);

    void setSignatureName(String name);

    void setWithFormBody(boolean withFormBody);


    void setWithApplicationBody(boolean withApplicationBody);

    void setConnectorBetweenBodyAndParam(String connectorBetweenBodyAndParam);

    void setBodyBefore(boolean bodyBefore);

    void setPrefix(String prefix);

    void setSuffix(String suffix);

    void setAround(String around);

    void setSignKey(String signKey);

    void setInterceptRule(InterceptRule interceptRule);
}
